package com.example.design.factory.version6;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 解析配置文件
 */
public class BeanProperties {
    private  static Properties pro=new Properties();

    static {
        InputStream in=Thread.currentThread().getContextClassLoader().getResourceAsStream("com/example/design/factory/version6/bean.properties");

        try {
            pro.load(in);   //加载配置文件的内容
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public  static  String   getClassName(String key){
        return  pro.getProperty(key);
    }

    public static void main(String[] args) {
        System.out.println(getClassName("root"));
    }
}
